package com.bdqn.util;
//读取属性文件中的信息

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class PropertiesUtil {

	private static Properties properties;
	
	static {
		properties=new Properties();
		String dbConfigPath = PropertiesUtil.class.getClassLoader().getResource(KeyConstants.DB_CONFIG_PATH).getPath();
		//将配置的属性文件加载到properties对象中
		try {
			properties.load(new FileReader(dbConfigPath));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static String getProperty(String key) {
		return properties.getProperty(key);
	}
	
	
}
